function trim(cadena){ 
    cadenaE="";
    for (i=0;i<cadena.length;i++){
        letra=cadena.substring(i,i+1);
        if (letra!=' ') { 
            cadenaE=cadenaE + letra; 
        }
    }
    return(cadenaE);
}

function EsNumero(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {
        var c = s.charAt(i);
        if (! (isDigit(c) ) || c=='.')
        return false;
    }
    return true;
}

function isDigit (c){   
    return ((c >= "0") && (c <= "9"))
}

function ingresoSoloMayusculasYDigitos(){        
    
    if((window.event.keyCode >= 97 && window.event.keyCode <= 122) || window.event.keyCode == 241 || window.event.keyCode == 154){
            window.event.keyCode -= 32;
    }
    else if(((window.event.keyCode < 65 || window.event.keyCode > 90) && (window.event.keyCode < 48 
        || window.event.keyCode > 57)) && window.event.keyCode != 209 
        && window.event.keyCode != 32){
            window.event.keyCode = 0;
    }	
}

function ingresoNumeroEnteroPositivo(){	
    if(window.event.keyCode < 48 || window.event.keyCode > 57){
        window.event.keyCode = 0;
    }
}

function ingresoSoloMayusculas(){
    if((window.event.keyCode >= 97 && window.event.keyCode <= 122) || 	window.event.keyCode == 241){
        window.event.keyCode -= 32;
    }
    else if((window.event.keyCode < 65 || window.event.keyCode > 90) && window.event.keyCode != 209 && window.event.keyCode != 32){
        window.event.keyCode = 0;
    }	
}